package models;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Collection;

/**
 * Created by john on 2016/9/11.
 */
@Entity
@Table(name = "t_UserInfo" )
public class UserInfo_T_Entity {
    private Integer fdUserId;
    private String fdUserName;
    private String fdImei;
    private String fdPasswordHash;
    private Integer fdDeptId;
    private String fdRegisterDate;
    private String fdLastLoginDate;
    private String fdToken;
    private String fdMobile;
    private Integer deleted = 0;
    private String fd_MemberNo;
    
//    private Collection<TApplyInfoEntity> tApplyInfosByFdUserId;
//    private Collection<TContractInfoEntity> tContractInfosByFdUserId;
//    private Collection<TContractInfoEntity> tContractInfosByFdUserId_0;
//    private DeptInfo_T_Entity tDeptInfoByFdDeptId;
//    private Collection<TUserInRoleEntity> tUserInRolesByFdUserId;
//    private Collection<TUserTruckEntity> tUserTrucksByFdUserId;

    @Id
    @GeneratedValue (strategy=GenerationType.IDENTITY)
    @Column(name = "fd_UserID", nullable = false)
    public Integer getFdUserId() {
        return fdUserId;
    }

    public void setFdUserId(Integer fdUserId) {
        this.fdUserId = fdUserId;
    }

    @Basic
    @Column(name = "fd_UserName", nullable = false, length = 20)
    public String getFdUserName() {
        return fdUserName;
    }

    public void setFdUserName(String fdUserName) {
        this.fdUserName = fdUserName;
    }

    @Basic
    @Column(name = "deleted", nullable = false)
    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }

    @Basic
    @Column(name = "fd_IMEI", nullable = false, length = 100)
    public String getFdImei() {
        return fdImei;
    }

    public void setFdImei(String fdImei) {
        this.fdImei = fdImei;
    }

    @Basic
    @Column(name = "fd_PasswordHash", nullable = false, length = 50)
    public String getFdPasswordHash() {
        return fdPasswordHash;
    }

    public void setFdPasswordHash(String fdPasswordHash) {
        this.fdPasswordHash = fdPasswordHash;
    }

    @Basic
    @Column(name = "fd_DeptId", nullable = false)
    public Integer getFdDeptId() {
        return fdDeptId;
    }

    public void setFdDeptId(Integer fdDeptId) {
        this.fdDeptId = fdDeptId;
    }

    @Basic
    @Column(name = "fd_RegisterDate", nullable = false)
    public String getFdRegisterDate() {
        return fdRegisterDate;
    }

    public void setFdRegisterDate(String fdRegisterDate) {
        this.fdRegisterDate = fdRegisterDate;
    }

    @Basic
    @Column(name = "fd_LastLoginDate", nullable = false)
    public String getFdLastLoginDate() {
        return fdLastLoginDate;
    }

    public void setFdLastLoginDate(String fdLastLoginDate) {
        this.fdLastLoginDate = fdLastLoginDate;
    }

    @Basic
    @Column(name = "fd_Token", nullable = false, length = 50)
    public String getFdToken() {
        return fdToken;
    }

    public void setFdToken(String fdToken) {
        this.fdToken = fdToken;
    }

    @Basic
    @Column(name = "fd_Mobile", nullable = false, length = 20)
    public String getFdMobile() {
        return fdMobile;
    }

    public void setFdMobile(String fdMobile) {
        this.fdMobile = fdMobile;
    }
/*
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        UserInfo_T_Entity that = (UserInfo_T_Entity) o;

        if (fdUserId != null ? !fdUserId.equals(that.fdUserId) : that.fdUserId != null) return false;
        if (fdUserName != null ? !fdUserName.equals(that.fdUserName) : that.fdUserName != null) return false;
        if (fdImei != null ? !fdImei.equals(that.fdImei) : that.fdImei != null) return false;
        if (fdPasswordHash != null ? !fdPasswordHash.equals(that.fdPasswordHash) : that.fdPasswordHash != null)
            return false;
        if (fdDeptId != null ? !fdDeptId.equals(that.fdDeptId) : that.fdDeptId != null) return false;
        if (fdRegisterDate != null ? !fdRegisterDate.equals(that.fdRegisterDate) : that.fdRegisterDate != null)
            return false;
        if (fdLastLoginDate != null ? !fdLastLoginDate.equals(that.fdLastLoginDate) : that.fdLastLoginDate != null)
            return false;
        if (fdToken != null ? !fdToken.equals(that.fdToken) : that.fdToken != null) return false;
        if (fdMobile != null ? !fdMobile.equals(that.fdMobile) : that.fdMobile != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = fdUserId != null ? fdUserId.hashCode() : 0;
        result = 31 * result + (fdUserName != null ? fdUserName.hashCode() : 0);
        result = 31 * result + (fdImei != null ? fdImei.hashCode() : 0);
        result = 31 * result + (fdPasswordHash != null ? fdPasswordHash.hashCode() : 0);
        result = 31 * result + (fdDeptId != null ? fdDeptId.hashCode() : 0);
        result = 31 * result + (fdRegisterDate != null ? fdRegisterDate.hashCode() : 0);
        result = 31 * result + (fdLastLoginDate != null ? fdLastLoginDate.hashCode() : 0);
        result = 31 * result + (fdToken != null ? fdToken.hashCode() : 0);
        result = 31 * result + (fdMobile != null ? fdMobile.hashCode() : 0);
        return result;
    }

    @OneToMany(mappedBy = "tUserInfoByFdApplicantId")
    public Collection<TApplyInfoEntity> gettApplyInfosByFdUserId() {
        return tApplyInfosByFdUserId;
    }

    public void settApplyInfosByFdUserId(Collection<TApplyInfoEntity> tApplyInfosByFdUserId) {
        this.tApplyInfosByFdUserId = tApplyInfosByFdUserId;
    }

 

    @OneToMany(mappedBy = "tUserInfoByFdUserAid")
    public Collection<TContractInfoEntity> gettContractInfosByFdUserId() {
        return tContractInfosByFdUserId;
    }

    public void settContractInfosByFdUserId(Collection<TContractInfoEntity> tContractInfosByFdUserId) {
        this.tContractInfosByFdUserId = tContractInfosByFdUserId;
    }

    @OneToMany(mappedBy = "tUserInfoByFdUserBid")
    public Collection<TContractInfoEntity> gettContractInfosByFdUserId_0() {
        return tContractInfosByFdUserId_0;
    }

    public void settContractInfosByFdUserId_0(Collection<TContractInfoEntity> tContractInfosByFdUserId_0) {
        this.tContractInfosByFdUserId_0 = tContractInfosByFdUserId_0;
    }


    @ManyToOne
    @JoinColumn(name = "fd_DeptId", referencedColumnName = "fd_DeptID", nullable = false, insertable = false, updatable = false)
    public DeptInfo_T_Entity gettDeptInfoByFdDeptId() {
        return tDeptInfoByFdDeptId;
    }

    public void settDeptInfoByFdDeptId(DeptInfo_T_Entity tDeptInfoByFdDeptId) {
        this.tDeptInfoByFdDeptId = tDeptInfoByFdDeptId;
    }

    @OneToMany(mappedBy = "tUserInfoByFdUserId")
    public Collection<TUserInRoleEntity> gettUserInRolesByFdUserId() {
        return tUserInRolesByFdUserId;
    }

    public void settUserInRolesByFdUserId(Collection<TUserInRoleEntity> tUserInRolesByFdUserId) {
        this.tUserInRolesByFdUserId = tUserInRolesByFdUserId;
    }

    @OneToMany(mappedBy = "tUserInfoByFdUserId")
    public Collection<TUserTruckEntity> gettUserTrucksByFdUserId() {
        return tUserTrucksByFdUserId;
    }

    public void settUserTrucksByFdUserId(Collection<TUserTruckEntity> tUserTrucksByFdUserId) {
        this.tUserTrucksByFdUserId = tUserTrucksByFdUserId;
    }
*/

	public String getFd_MemberNo() {
		return fd_MemberNo;
	}

	public void setFd_MemberNo(String fd_MemberNo) {
		this.fd_MemberNo = fd_MemberNo;
	}
}
